package parsexml.enity;

import java.util.HashSet;
import java.util.Set;

/**
 * @author 李栋
 * @version 1.0.0
 * @className XmlStudent.java
 * @createTime 2021年07月14日 20:21:00
 */
public class XmlStudent {

    private String sno;

    private String name;

    private String gender;

    private Set<XmlSubject> xmlSubjects = new HashSet<>();

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Set<XmlSubject> getXmlSubjects() {
        return xmlSubjects;
    }

    public void setXmlSubjects(Set<XmlSubject> xmlSubjects) {
        this.xmlSubjects = xmlSubjects;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        XmlStudent that = (XmlStudent) o;

        return sno.equals(that.sno);
    }

    @Override
    public int hashCode() {
        return sno.hashCode();
    }
}
